﻿using System.Web.Http;
using Pigg.Contracts;

namespace Pigg.WebUi.Controllers.api
{
    [RoutePrefix("api")]
    public class MenuController : ApiController
    {
        private readonly IPiggUow _piggUow;

        public MenuController(IPiggUow piggUow)
        {
            _piggUow = piggUow;
        }

        [Route("Menu/{culture}/{menuName}")]
        public IHttpActionResult Get(string culture, string menuName)
        {
            var results = _piggUow.ModelReader.GetMenu(culture, menuName);
            return Ok(new {menu = results});
        }

        //{
        //        url: '/admin',
        //        config: {
        //            title: 'Admin',
        //            templateUrl: 'app/admin/admin.html',
        //            settings: {
        //                nav: 2,
        //                content: '<i class="icon-lock"></i> Admin'
        //            }
        //        }
    }
}